<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>B页面</title>
</head>

<body>
    <p>B页面</p>
</body>
<script type="text/javascript" src="sdk_b.js"></script>
<script type="text/javascript">
    // 1）触发父页面定义的方法
    window.SDK.sayHi({ msg: '触发父页面定义的方法' });

    // 2）向父页面请求获取数据 uname
    var uname = '';
    window.SDK.getUname();
    setTimeout(function () {
        uname = window.SDK.uname;
        //doSomething(uname);
        console.log("向父页面请求获取数据 uname", uname)
    }, 2000);
    // 备注：发送请求后，需要延时接收返回的数据

    window.SDK.colseChildIframe({ "key": "value" });
</script>

</html>